package com.multicampus.simplewiki.control;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import com.multicampus.simplewiki.model.Document;

public class NewViewPageController implements Controller {

	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		ModelAndView mav = new ModelAndView("/wikipage/newView_page");
		mav.addObject("parentId", request.getParameter("parentId"));
		Document document = new Document();
		document.setTitle(request.getParameter("title"));
		mav.addObject("document", document);
		
		return mav;
	}
}
